Skip to main content
This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal

Notes/Domino 8 Forum

Notes/Domino 8 Forum

Previous Next
Subject: Java can't create MIME Header?
Feedback Type: Problem
Product Area: Domino Server
Technical Area: Functionality
Platform: ALL
Release: All
Reproducible: Always

OK, I'm using a Java agent to loop through and convert an number of Base64 strings to the images they represent. I'm having trouble setting the headerVal. Below is the block of code. Logging shows I'm getting the body as it is already a MIMEEntity, but even thought I create the header, (twice) it's not their either time - so both lines where I say the header is null print. I finally get a null pointer exception on the header.setHeaderVal("image/png") line. Can someone please tell me what I'm missing here?

Cheers,
Brian
MIMEEntity body;
if(doc.hasItem("body")){
System.out.println("has MIME body");
body = doc.getMIMEEntity("body");
} else {
System.out.println("before create MIME body");
body = doc.createMIMEEntity();
}
if(body == null){
body = doc.createMIMEEntity();
System.out.println("body was null");
}
System.out.println("after body item");
allObjects.addElement(body);

if (body == null){
System.out.println("hmm, body is null");
}

System.out.println("before header");
//MIMEHeader header = null;
MIMEHeader header = body.createHeader("Content-Type");
System.out.println("after header");
if(header == null ){
System.out.println("header was null???");
header = body.createHeader("Content-Type");
System.out.println("after header null create");
}
allObjects.addElement(header);
if(header == null ){
System.out.println("header was null AGAIN???");
header = body.createHeader("Content-Type");
System.out.println("after header null create AGAIN");
}
System.out.println("after header add object");
header.setHeaderVal("image/png");






Feedback number WEBB8ZSNTD created by ~Delores Ekfreeverakol on 11/06/2012

Status: Open
Comments:





Printer-friendly

Search this forum

Member Tools


RSS Feeds

 RSS feedsRSS
All forum posts RSS
All main topics RSS